<?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'Date') ?>
<title><?= $sf_response->getTitle() ?></title>
<?php use_helper('DateForm') ?>
<?php use_stylesheet('excelbutton') ?>
<?php use_stylesheet('/sf/sf_admin/css/main') ?>


<style type="text/css">
<!--
.style1 {
	font-size: 24px;
	font-weight: bold;
	color: #CC00CC;
}
.style2 {
	color: #0000FF;
	font-weight: bold;
}
-->
</style>

<div id="sf_admin_container">

<h1>Provision report</h1>

<div id="sf_admin_content">
<?php echo form_tag('report/provision', array(
  'id'        => 'sf_admin_edit_form',
  'name'      => 'sf_admin_edit_form',
  'multipart' => true,
)) ?>

<fieldset id="sf_fieldset_none" class="">

<div class="form-row">
  <label for="client_name" class="required">Year:</label>
  <div class="content">  



  
  <?php
   
   	echo '<select name="filters[year]" id="filters[year]">';
	   for ($i = 5; $i > 0; $i--) {
	   		echo '<option ';
                        echo isset($filters['year']) && ($filters['year'] ==$i)? ' selected="selected" ': '';
                        echo ' value="'.$i.'" >'.$i.'</option>';
	   }
	   echo '</select>';
  ?>
  </div>
</div>




</fieldset>
<ul class="sf_admin_actions">
  <li><?php echo submit_tag(__('report'), array (
  'name' => 'report',
  'class' => 'sf_admin_action_save',
)) ?></li>
   <li><?php echo submit_tag(__('Export To Excel'), array (
  'name' => 'ExportToExcel',
  'class' => 'sf_admin_action_save',
)) ?></li>

</ul>

</form> 

<? 
if (isset($result) && count($result) )
{
   $keysRow = array_keys($result);
   $keysCol = array_keys($result[$keysRow[0]]);
?>
<i>This list includes items which: [tally out quantity = tally in quantity = 0] during number of years has been chosen</i>
<table width="100%" border="1" cellpadding="0" cellspacing="0" class="textalignright">
  <tr>
    <td><strong>NO</strong></td>
    <? 
    
    foreach ($keysCol as $key) 
    {
    ?>
        <td><strong><? echo $key?></strong></td>
    <?    
    }
    ?>
  </tr>
<? 
foreach ($keysRow as $row)
{
?>
  <tr>
    <td><?echo $row?></td>    
    <? foreach ($keysCol as $col) 
    {
    ?>
        <td><?
    if (isset($rightAlign[$col]))
        echo '<p align="right">';
    echo $result[$row][$col];
    ?></td>
    <?    
    }
    ?>
    
  </tr>
<?
}
?>
</table>
<?}?>

</div>
</div>

